Skip to content

Fix metrics not reporting new values#5781

Merged
isum merged 1 commit intomasterfrom
ion/fix-metrics-not-reporting-new-values
Feb 17, 2025
Merged

Fix metrics not reporting new values#5781
isum merged 1 commit intomasterfrom
ion/fix-metrics-not-reporting-new-values

Conversation

@isum
Copy link
Member

@isum isum commented Jan 23, 2025

This PR updates the metric registration mechanism so that the most recent metric registration attempt is considered valid and the previous registration is discarded, fixing a long-standing issue that caused multiple metrics to fail to report new values.

Closes #5758

Context

In the previous implementation, only the first metric registration was considered valid, and all subsequent attempts to create the same metric were internally considered invalid. External modules always get a metric on calls to register, even if the registration fails internally. This was a problem because many operations in graph-node are expected to be executed multiple times, and the limited cleanup of old metrics was not working as expected. The result was that many operations in graph-node had non-working metrics after restarts. An example is the subgraph runner, which silently got unregistered metrics after almost every deployment restart/reassignment.

Testing

I have tested the fix locally and the previously broken metrics are now working as expected. The behavior of previously working metrics has not changed.

@isum isum added the metrics label Jan 23, 2025
@isum isum self-assigned this Jan 23, 2025
@fordN fordN linked an issue Jan 23, 2025 that may be closed by this pull request
@isum isum marked this pull request as ready for review January 23, 2025 18:45
@fordN fordN requested a review from encalypto January 30, 2025 16:53
@fordN fordN requested a review from mangas February 11, 2025 16:46
@isum isum force-pushed the ion/fix-metrics-not-reporting-new-values branch from cc8f006 to 1e93e43 Compare February 17, 2025 07:43
@isum isum merged commit 4598125 into master Feb 17, 2025
6 checks passed
@isum isum deleted the ion/fix-metrics-not-reporting-new-values branch February 17, 2025 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix: ensure recreating metrics works as expected

2 participants

Comments